
const x = 100 ;
// x = 200 ; // TypeError: Assignment to constant variable.
console.log( x );

const boyFriend = { gender: '男' }

// boyFriend = new Object(); // TypeError: Assignment to constant variable.

console.log( boyFriend );

// 修改常量指向的对象的属性值
boyFriend.gender = '女' ;

console.log( boyFriend );

const stu = {}

Object.defineProperty( stu , 'name' , {
    value: '朱文杰' ,
    configurable: false ,
    writable: false ,
    enumerable: true 
} );

console.log( stu );

stu.name = '老朱' ;

console.log( stu );

const $http = {
    '0' : 'UNSENT' ,
    '1' : 'OPEND'
}

Object.freeze( $http );

console.log( $http );

$http[ '0' ] = '未发送' ;

console.log( $http );